// To parse this JSON data, do
//
//     final favType = favTypeFromJson(jsonString);

import 'dart:convert';

FavListResp favListRespFromJson(String str) => FavListResp.fromJson(json.decode(str));

String favListRespToJson(FavListResp data) => json.encode(data.toJson());

class FavListResp {
  FavListData data;
  int errorCode;
  String errorMsg;

  FavListResp({
    required this.data,
    required this.errorCode,
    required this.errorMsg,
  });

  factory FavListResp.fromJson(Map<String, dynamic> json) => FavListResp(
        data: FavListData.fromJson(json["data"]),
        errorCode: json["errorCode"],
        errorMsg: json["errorMsg"],
      );

  Map<String, dynamic> toJson() => {
        "data": data.toJson(),
        "errorCode": errorCode,
        "errorMsg": errorMsg,
      };
}

class FavListData {
  int curPage;
  List<FavItemData> datas;
  int offset;
  bool over;
  int pageCount;
  int size;
  int total;

  FavListData({
    required this.curPage,
    required this.datas,
    required this.offset,
    required this.over,
    required this.pageCount,
    required this.size,
    required this.total,
  });

  factory FavListData.fromJson(Map<String, dynamic> json) => FavListData(
        curPage: json["curPage"],
        datas: List<FavItemData>.from(
            json["datas"].map((x) => FavItemData.fromJson(x))),
        offset: json["offset"],
        over: json["over"],
        pageCount: json["pageCount"],
        size: json["size"],
        total: json["total"],
      );

  Map<String, dynamic> toJson() => {
        "curPage": curPage,
        "datas": List<dynamic>.from(datas.map((x) => x.toJson())),
        "offset": offset,
        "over": over,
        "pageCount": pageCount,
        "size": size,
        "total": total,
      };
}

class FavItemData {
  String author;
  int chapterId;
  String chapterName;
  int courseId;
  String desc;
  String envelopePic;
  int id;
  String link;
  String niceDate;
  String origin;
  int originId;
  int publishTime;
  String title;
  int userId;
  int visible;
  int zan;

  FavItemData({
    required this.author,
    required this.chapterId,
    required this.chapterName,
    required this.courseId,
    required this.desc,
    required this.envelopePic,
    required this.id,
    required this.link,
    required this.niceDate,
    required this.origin,
    required this.originId,
    required this.publishTime,
    required this.title,
    required this.userId,
    required this.visible,
    required this.zan,
  });

  factory FavItemData.fromJson(Map<String, dynamic> json) => FavItemData(
        author: json["author"],
        chapterId: json["chapterId"],
        chapterName: json["chapterName"],
        courseId: json["courseId"],
        desc: json["desc"],
        envelopePic: json["envelopePic"],
        id: json["id"],
        link: json["link"],
        niceDate: json["niceDate"],
        origin: json["origin"],
        originId: json["originId"],
        publishTime: json["publishTime"],
        title: json["title"],
        userId: json["userId"],
        visible: json["visible"],
        zan: json["zan"],
      );

  Map<String, dynamic> toJson() => {
        "author": author,
        "chapterId": chapterId,
        "chapterName": chapterName,
        "courseId": courseId,
        "desc": desc,
        "envelopePic": envelopePic,
        "id": id,
        "link": link,
        "niceDate": niceDate,
        "origin": origin,
        "originId": originId,
        "publishTime": publishTime,
        "title": title,
        "userId": userId,
        "visible": visible,
        "zan": zan,
      };
}


class CommonFav {
  dynamic data;
  int errorCode;
  String errorMsg;

  CommonFav({
    required this.data,
    required this.errorCode,
    required this.errorMsg,
  });

  factory CommonFav.fromJson(Map<String, dynamic> json) => CommonFav(
        data: json["data"],
        errorCode: json["errorCode"],
        errorMsg: json["errorMsg"],
      );

  Map<String, dynamic> toJson() => {
        "data": data,
        "errorCode": errorCode,
        "errorMsg": errorMsg,
      };
}